<template>
  <div>
    <headers title="首页"></headers>
    <van-grid :border="false" :column-num="1">
      <van-grid-item v-for="(v, i) in list" :key="i">
        <van-image
          :src="
            v.goods_small_logo
              ? v.goods_small_logo
              : 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg'
          "
          style="width: 150px;"
        />
        <div class="item" >{{ v.goods_name }}</div>
        <div class="mian" style="color: #ff5f16;">${{ v.goods_price }}</div>
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { searchApi } from "@/api/api";
import headers from "@/components/header.vue";

const list = ref([]);

const searchFun = () => {
  searchApi().then((res) => {
    list.value = res.data.message.goods;
  });
};
searchFun();
</script>

<style lang="scss" scoped>
.box {
  width: 100%;
  height: 100%;
}
</style>
